<template>
    <div>子组件</div>
</template>

<script>
  import { ref } from 'vue'
  export default {
    name: 'child',
    async setup()
    {
      let sum = ref(0)

      //创建一个异步对象
      let p = new Promise((resolve) => {
        setTimeout(() => {
          resolve({ sum })
        }, 3000)
      })

      //返回结果
      return await p
    }
  }
</script>